<?php
/***
 * 资源-资源图
 */
namespace app\model;

use think\Model;


class ResourceMapModel extends Model
{
	// 设置当前模型对应的完整数据表名称
	protected $name = 'resources_map';
	
	// 设置字段信息
	protected $schema111 = [
			'id'          => 'int',
			'park_name'        => 'string',
	];
	
	// 设置当前模型的数据库连接
	protected $connection ='db_yunduan';
	
	/**
	 * 资源图详情
	 */
	public function GetDetail($field='*',$condition=array()){
		
		$obj = new ResourceMapModel();
		$obj=$obj->alias('a');
		$where=" 1=1 ";
		
		
		/***城市*/
		if(isset($condition['city_id'])&&!empty($condition['city_id'])){
			$where.=" and  a.city_id={$condition['city_id']}   ";
		}
		/***园区*/
		if(isset($condition['park_id'])&&!empty($condition['park_id'])){
			$where.=" and  a.park_id={$condition['park_id']}   ";
		}
		
		$info=$obj->field($field)->where($where)->find();
		
		return $info;
	}
	
	
}
